<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Commands.html">
<link rel="next" href="Exceptions.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Commands" rel="Chapter" href="Commands.html">
<link title="Declaration" rel="Chapter" href="Declaration.html">
<link title="Exceptions" rel="Chapter" href="Exceptions.html">
<link title="Expressions" rel="Chapter" href="Expressions.html">
<link title="Intermediate" rel="Chapter" href="Intermediate.html">
<link title="Lexer" rel="Chapter" href="Lexer.html">
<link title="Main" rel="Chapter" href="Main.html">
<link title="Parser" rel="Chapter" href="Parser.html">
<link title="Print" rel="Chapter" href="Print.html">
<link title="Print_syntaxtree" rel="Chapter" href="Print_syntaxtree.html">
<link title="Semantic" rel="Chapter" href="Semantic.html">
<link title="Subroutines" rel="Chapter" href="Subroutines.html">
<link title="Syntaxtree" rel="Chapter" href="Syntaxtree.html">
<link title="Target" rel="Chapter" href="Target.html"><title>Declaration</title>
</head>
<body>
<div class="navbar"><a href="Commands.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Exceptions.html">Next</a>
</div>
<center><h1>Module <a href="type_Declaration.html">Declaration</a></h1></center>
<br>
<pre><span class="keyword">module</span> Declaration: <code class="code">sig</code> <a href="Declaration.html">..</a> <code class="code">end</code></pre>Here are all the functions used to generate the declaration table<br>
<hr width="100%">
<br>
Here are all the functions used to generate the declaration table<br>
<pre><span class="keyword">val</span> <a name="VALgenBtype"></a><a href="code_VALDeclaration.genBtype.html">genBtype</a> : <code class="type">int -><br>       int -><br>       <a href="Syntaxtree.html#TYPEbType">Syntaxtree.bType</a> -><br>       <a href="Intermediate.intermediateCode.html">Intermediate.intermediateCode</a> -> bool -> int * int * <a href="Intermediate.html#TYPEelement">Intermediate.element</a></code></pre><div class="info">
Used to create a single variable entry on the dec_table<br>
<b>Returns</b> The entry which is binded into the Hashtable<br>
</div>
<div class="param_info"><code class="code">idx</code> : The index of the variable (1 for single variables, the vector index for Vector or Matrix)</div>
<div class="param_info"><code class="code">dim</code> : The dimension of a line (1 for single variable, the number of columns for Vector or Matrix)</div>
<div class="param_info"><code class="code">bt</code> : The Basic type of the variable (int or float)</div>
<div class="param_info"><code class="code">ic</code> : The instance of the IntermediateCode class</div>
<div class="param_info"><code class="code">b</code> : True if the variable is declared into a subroutine, false if it's created globally</div>
<pre><span class="keyword">val</span> <a name="VALgenGtype"></a><a href="code_VALDeclaration.genGtype.html">genGtype</a> : <code class="type"><a href="Syntaxtree.html#TYPEide">Syntaxtree.ide</a> -><br>       <a href="Syntaxtree.html#TYPEgType">Syntaxtree.gType</a> -><br>       <a href="Intermediate.html#TYPEdec_table">Intermediate.dec_table</a> -> <a href="Intermediate.intermediateCode.html">Intermediate.intermediateCode</a> -> bool -> unit</code></pre><div class="info">
Used to build the correct number of entries into the Declaration Hashtable<br>
</div>
<div class="param_info"><code class="code">id</code> : The ide of the variable, which is used as key for the table</div>
<div class="param_info"><code class="code">t</code> : The generic Type of the variable</div>
<div class="param_info"><code class="code">table</code> : The declaration Table</div>
<div class="param_info"><code class="code">ic</code> : The instance of the IntermediateCode class</div>
<div class="param_info"><code class="code">b</code> : True if the variable is declared into a subroutine, false if it's created globally</div>
<br>
This works only with bi-dimensional Matrix, not with n-dimensional Vectors<br>
<pre><span class="keyword">val</span> <a name="VALgenDecTable"></a><a href="code_VALDeclaration.genDecTable.html">genDecTable</a> : <code class="type"><a href="Syntaxtree.html#TYPEdec">Syntaxtree.dec</a> list -><br>       <a href="Intermediate.html#TYPEdec_table">Intermediate.dec_table</a> -><br>       <a href="Intermediate.intermediateCode.html">Intermediate.intermediateCode</a> -> bool -> <a href="Intermediate.html#TYPEdec_table">Intermediate.dec_table</a></code></pre><div class="info">
Generate the table of declarations from the dec list<br>
<b>Returns</b> The updated table of declaration<br>
</div>
<div class="param_info"><code class="code">decl</code> : The declaration list</div>
<div class="param_info"><code class="code">table</code> : The declaration Hashtable</div>
<div class="param_info"><code class="code">ic</code> : The instance of the IntermediateCode class</div>
<div class="param_info"><code class="code">b</code> : True if the variable is declared into a subroutine, false if it's created globally</div>
<pre><span class="keyword">val</span> <a name="VALgetVarDeclaration"></a><a href="code_VALDeclaration.getVarDeclaration.html">getVarDeclaration</a> : <code class="type"><a href="Syntaxtree.html#TYPEide">Syntaxtree.ide</a> -> <a href="Intermediate.html#TYPEdec_table">Intermediate.dec_table</a> -> int * int * <a href="Intermediate.html#TYPEelement">Intermediate.element</a></code></pre><div class="info">
Find the binded value corresponding to the ide into the Hashtable (where ide is the identifier for a variable, NOT Vectors or Matrix)<br>
<b>Raises</b> <code>NON_DECLARED_VARIABLE</code> When the requested ide isn't binded into the table<br>
<b>Returns</b> The value binded with Ide(id) into table<br>
</div>
<div class="param_info"><code class="code">table</code> : The declaration table</div>
<pre><span class="keyword">val</span> <a name="VALgetVecDeclaration"></a><a href="code_VALDeclaration.getVecDeclaration.html">getVecDeclaration</a> : <code class="type"><a href="Syntaxtree.html#TYPEide">Syntaxtree.ide</a> -><br>       int -> int -> <a href="Intermediate.html#TYPEdec_table">Intermediate.dec_table</a> -> int * int * <a href="Intermediate.html#TYPEelement">Intermediate.element</a></code></pre><div class="info">
Find the binded value corresponding to the ide into the Hashtable (where ide is the identifier for Vectors or Matrix)<br>
<b>Raises</b> <code>NON_DECLARED_VARIABLE</code> When the requested ide isn't binded into the table<br>
<b>Returns</b> The value binded with Ide(id) with the specified components into table<br>
</div>
<div class="param_info"><code class="code">x</code> : The X coordinate of the Vector/Matrix</div>
<div class="param_info"><code class="code">y</code> : The Y coordinate of the Matrix (-1 if the ide refers to a Vector, which has only one component)</div>
<div class="param_info"><code class="code">table</code> : The declaration table</div>
<pre><span class="keyword">val</span> <a name="VALisVarDeclared"></a><a href="code_VALDeclaration.isVarDeclared.html">isVarDeclared</a> : <code class="type"><a href="Syntaxtree.html#TYPEide">Syntaxtree.ide</a> -> <a href="Intermediate.html#TYPEdec_table">Intermediate.dec_table</a> -> bool</code></pre><div class="info">
Check if the variable is binded into the Hashtable<br>
<b>Returns</b> True of the variable is binded, False otherwise<br>
</div>
<div class="param_info"><code class="code">id</code> : The ide of the variable to check</div>
<div class="param_info"><code class="code">table</code> : The declaration Table</div>
</body></html>